<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变异操作</title>
</head>
<body>

</body>
<script>

    var employees = [
        {
            id:1,
            name:'Mat',
            gender:'male'
        },  {
            id:2,
            name:'Mary',
            gender:'female'
        }
    ]

    /**
     *  1. 尾部操作
     * */

   /*  employees.push({
         id:3,
         name:'Martin'
     })

    console.log(employees);

   var emp3=  employees.pop();

    console.log(employees);*/


   /**
    *   2. 头部操作
    * */

    employees.unshift({
        id:3,
        name:'Tea'
    })

   var emp3= employees.shift();




</script>

</html>